<table width="980"  border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
    	<td height="27" colspan="2" align="right">
        	<table width="382"  border="0" cellpadding="0" cellspacing="0" style="background-image:url('/images/header-bar.gif');">
      			<tr >
        			<td height="31" align="center" class="bodytextwhite10pt">
        				<a href="/feedback.php" class="bodytextwhite10pt">Feedback</a> &nbsp;|&nbsp; 
        				<a href="/tellafriend.php" class="bodytextwhite10pt">Invite a Colleague</a> &nbsp;|&nbsp; 
        				<a href="/my-profile" class="bodytextwhite10pt">Manage my profile</a> | 
        				<a href="/logout.php" class="bodytextwhite10pt">Sign out</a>
        			</td>
      			</tr>
    		</table>
		</td>
	</tr>
  	<tr>
    	<td width="626" height="67">
        	<a href="/mypage.php"><img src="/images/logo.gif" width="300" height="67" border="0"  alt="mywhitecoat"/></a>
        </td>
    	<td width="354" rowspan="2" align="right">
			<tal:block tal:content="php: this.profile()" />
        </td>
	</tr>
  	<tr>
    	<td>&nbsp;</td>
	</tr>
    <tr>
    	<td height="66" colspan="2" align="left" valign="top" style="background-image:url(/images/sub-header.gif); background-position:top; background-repeat:no-repeat">
   			<form name="search_content" id="search_content" action="/mwc/search" method="post">
				<table width="980" border="0" cellspacing="0" cellpadding="0">
     	 			<tr>
        				<td height="59" style="padding-left: 20px">
        					<table width="120"  border="0" cellpadding="0" cellspacing="0">
         						<tr>
         							<td align="center" valign="top" height="34">
         								<a href="/mypage.php" class="menutop">My Page </a>
         							</td>
         						</tr>
        					</table>        
        				</td>
        				<td height="59" colspan="4" align="right" valign="middle">
        					<table width="820" border="0" cellpadding="0" cellspacing="0">
          						<tr>
          							<td class="bodytext10pt" height="34" width="261" align="left">
          								<!--<strong class="branding" style="color:#FFFFFF"> Nursing </strong>--></td>
       						  <td width="148" height="34" align="right" class="bodytext10pt">
            							<strong class="subheadingblue">Featured Content: </strong>            						</td>
           						  <td width="17" align="right" class="bodytext10pt">&nbsp;</td>
            						<td width="120" align="center" valign="middle">
										<a href="/physicians.php" class="menutop">Physicians </a>
									</td>
            						<td width="8" align="center" valign="middle">&nbsp;</td>
            						<td width="120" align="center" valign="middle">
										<a href="/pharmacist.php" class="menutop">Pharmacists</a>
									</td>
            						<td width="8" align="center" valign="middle">&nbsp;</td>
            						<td width="120" align="center" valign="middle">
										<a href="/nurses.php" class="menutop">Nurses</a>
									</td>
									<td width="8" align="center" valign="middle">&nbsp;</td>
            						<td width="10">&nbsp;</td>
            					</tr>
            				</table>
            			</td>
            		</tr>     
      				<tr>      	
        				<td width="400" height="40" valign="middle" class="bodytext10pt">
        					&nbsp;&nbsp;&nbsp;&nbsp;<strong style="color:#FFFFFF;">Search </strong>
        				</td>
        				<td width="22" valign="middle" class="bodytext10pt" >
							&nbsp;<img src="/images/search.gif" border="0" /> 
						</td>
       					<td width="250" valign="top" class="bodytext10pt"  style="padding-top:11px; padding-left:0px">
       					<?
                            $ctx->searchValue = 'Type what you are looking for!';
                            if($_REQUEST['sword'] && $_REQUEST['sword'] != '') {
                                $ctx->searchValue = $_REQUEST['sword'];
                            }
       					?><div id="yuiAutoComplete"   > 
       							<input name="sword" type="text" class="bodytext10pt" value="${searchValue}" onclick="javascript:document.search_content.sword.value=''" onfocus="javascript:document.search_content.sword.value=''" onchange="javacript:if(document.search_content.sword.value==''){document.search_content.sword.value='Type what you are looking for!'}" onblur="javacript:if(document.search_content.sword.value==''){document.search_content.sword.value='Type what you are looking for!'}"  size="33" style="background-color:#f7f7f7; border:none" id="yuiInput"/><div id="yuiContainer" class="yui-skin-sam yui-ac-container" style="width:inherit"></div> 
						 </div>
        					 
        				</td>
        				<td width="351" valign="middle" class="bodytext10pt">
        					<strong style="color:#38509d;">in</strong>&nbsp;
			  				<select name="category" id="category" style="width:150px;">
								<option value="0" class="MenuLinksBlue">All</option>
									<option value="blogs" >Blog</option>
									<option value="MediaCast" >Media</option>
									<option value="Exclusives" >Exclusives</option>
									<option value="forums" >Forum</option>
									<option value="qna" >Question</option>
									<option value="news" >News</option>
									<option value="users" >Members</option>
									<option value="groups" >Groups</option>
                                    <optgroup label="MWC Library">
                                    <option value="drug">Drug</option>
						            <option value="disease">Disease</option>
                                    <!--<option value="biochem">BioChem</option>-->
                                    <option value="clinicalTrial">Clinical Trial</option>
                                    <option value="organization">Organization</option>
						            <option value="methodOfAction">Mechanism-of-Action</option></optgroup>
<!--  <option value="gene">Gene</option> <option value="protein">Protein</option><option value="pubmedRecord">PubMed Record</option> -->
 						    </select>
								<button style="background:url(/images/button-go.gif) no-repeat; cursor:pointer; padding:0 0 2px 0;border:0 none;height:18px;width:38px;color:#FFFFFF;font-family:Verdana, Arial, Helvetica, sans-serif" onclick="document.search_content.submit();">GO</button>
					  </td>
							<td align="right" valign="middle" class="bodytext10pt" style="padding-top:4px;padding-right:15px" >
        						<div dojoType="dev.form.AddContentButton" style="background:url(/images/button-addcontent.gif)  no-repeat;" >
        						  <table> <td align="center" style="padding-top:2px"></td></table>
            						<div dojoType="dijit.Menu" id="Edit" >
                						<div dojoType="dijit.MenuItem" label="Video" onclick="add_content('Video', '0')"></div>
                						<div dojoType="dijit.MenuItem" label="Audio" onclick="add_content('Audio', '0')"></div>
                						<div dojoType="dijit.MenuItem" label="Forum" onclick="add_content('Forum', '0')"></div>
										<div dojoType="dijit.MenuItem" label="Blog" onclick="add_content('Blog', '0')"></div>
                						<div dojoType="dijit.MenuItem" label="Question" onclick="add_content('Question', '0')"></div>
            						</div>
        						</div>
        					</td>
				  </tr>
			  </table>
		  </form>
    		</td>
    	</tr>
    </table>
    <form action="/alitoraDetails.php" enctype="application/x-www-form-urlencoded" method="get" id="quickSearchForm">
			<!-- <input type="hidden" name="quickSearch" id="quickSearchID" value="true"></input> -->
			<input type="hidden" name="umis" id="quickSearchUMIS_ID" value=""></input>
            <input type="hidden" name="fname" id="fname" value=""></input>
</form>
<script type="text/javascript">
	YAHOO.example.BasicRemote = function() {
		// Use an XHRDataSource
		var oDS = new YAHOO.util.XHRDataSource("/lib/Alitora/autoSuggestion.php");
		// Set the responseType
		oDS.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
		// Define the schema of the delimited results
		oDS.responseSchema = {
			resultsList : "ResultSet.Result", 
			fields : ["name","umis","type"] 
		};
		//define your itemSelect handler function: 
		var itemSelectHandler = function(sType, aArgs) { 
			YAHOO.log(sType); // this is a string representing the event; 
						// e.g., "itemSelectEvent" 
			var oMyAcInstance = aArgs[0]; // your AutoComplete instance 
			var elListItem = aArgs[1]; // the   element selected in the suggestion 
									   // container 
			var oData = aArgs[2]; // object literal of data for the result


			//we need to sumbit the query with additional parameter

			//document.getElementById('quickSearchID').value = true;
			var filename =   oData.type;
			var fname = filename.split('.');
			document.getElementById('fname').value = fname[0];
			
			document.getElementById('quickSearchUMIS_ID').value = oData.umis;
			
			document.getElementById('quickSearchForm').submit();

		}; 

		// Instantiate the AutoComplete
		var oAC = new YAHOO.widget.AutoComplete("yuiInput", "yuiContainer", oDS);
		oAC.itemSelectEvent.subscribe(itemSelectHandler); 
		
		//subscribe your handler to the event, assuming 
		//you have an AutoComplete instance myAC:
		
		oAC.generateRequest = function(sQuery) {

			var dropdownIndex = document.getElementById('category').selectedIndex;
			var dropdownValue = document.getElementById('category')[dropdownIndex].value;
			 
			return "?type=" +dropdownValue + "&maxHits=6" + "&query=" + sQuery; 
		};

		// Display up to 10 results in the container 
		oAC.maxResultsDisplayed = 10;

		// Require user to type at least 3 characters before triggering a query 
		oAC.minQueryLength = 3;

		// Do not automatically highlight the first result item in the container 
		oAC.autoHighlight = false;   

		// Whether or not the input field should be updated with selections. 
		oAC.suppressInputUpdate = true;

		// Result data passed as object for easy access from custom formatter. 
		oAC.resultTypeList = false; 
		// Customize formatter to show thumbnail images 
		oAC.formatResult = function(oResultData, sQuery, sResultMatch) { 
			return oResultData.name; 
		}; 
		 
		return {
			oDS: oDS,
			oAC: oAC
		};
	}();

</script>